package com.yfqy.app.modules.product.resource;

import com.yfqy.app.modules.product.vo.LabelVO;
import com.yfqy.app.modules.product.service.LabelService;
import com.yfqy.app.domain.vo.ResultVO;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/api/client/label")
public class LabelController {

    private final LabelService labelService;

    public LabelController(LabelService labelService) {
        this.labelService = labelService;
    }


    // 查询标签列表
    @GetMapping("/list")
    public ResultVO<List<LabelVO>> getLabelList(
            @RequestParam(required = false) String labelName,
            @RequestParam(required = false) Integer status) {
        List<LabelVO> list = labelService.getLabelList(labelName, status);
        return ResultVO.data(list);
    }

}
